<!DOCTYPE html>
<html>

<head>
<th:block th:replace="/fragments/head" />
</head>

<body class="dashboard-page sb-l-o">
	<!--/* 主题设置面板 */-->
	<div th:replace="/fragments/skin-toolbox"></div>

	<!-- BEGIN: 主页面 -->
	<div id="main">
		<!--/* 顶部导航 */-->
		<header th:replace="/fragments/header-banner"></header>
		<!--/* 左侧功能菜单导航 */-->
		<aside th:replace="/fragments/aside"></aside>
		<!-- BEGIN: Content-Wrapper -->
		<section id="content_wrapper">
			<!--/* 模块路径导航条 */-->
			<header th:replace="/fragments/header-breadcrumb"></header>

			<!-- Begin: 业务办理区 -->
			<!-- Begin: Content -->
			<section id="contents" class="animated fadeIn">

				<!-- Validation Example -->
				<div class="admin-form">

					<div class="panel heading-border">

						<form method="post" action="#" id="admin-form2" class="form-horizontal">

							<div class="form-group panel-body">
								<label class="col-md-1 control-label">参数名称：</label>
								<div class="col-md-2 field">
									<input name="name" class="form-control" />
								</div>
								<label class="col-md-1 control-label">参数键：</label>
								<div class="col-md-2 field">
									<input name="param_key" class="form-control" />
								</div>
								<label class="col-md-1 control-label">参数值</label>
								<div class="col-md-2 field">
									<input name="value" class="form-control" />
								</div>
								<label class="col-md-1 control-label">所属系统：</label>
								<div class="col-md-2 field">
									<select name="sys_key" class="basic-single form-control">
										<option></option>
										<option value="0">缺省全局</option>
									</select>
								</div>
							</div>


							<!-- end .form-footer section -->
						</form>
						
													<!-- end .form-body section -->
							<div class="panel-footer text-right">
								<button type="submit" id="btn-query" class="button btn-primary">Validate Form</button>
								<button type="reset" class="button">Cancel</button>
							</div>

					</div>

				</div>
				<!-- end: .admin-form -->

			</section>
			<!-- End: Content -->
			<!-- End: 业务办理区 -->

			<!--/* 页脚 */-->
			<footer th:replace="/fragments/footer"></footer>

		</section>
		<!-- End: Content-Wrapper -->

	</div>
	<!-- End: 主页面 -->

	<!--/* 公共脚本文件 */-->
	<th:block th:include="/fragments/scripts" />

	<script th:inline="javascript">
		/*<![CDATA[*/
		jQuery(document).ready(function() {
			"use strict";
			Core.init();
			$("#btn-query").on("click", test);

            function test(){
    			$("#admin-form2").validate({

    				/* @validation states + elements 
    				------------------------------------------- */
    				errorElement : "em",

    				/* @validation rules 
    				------------------------------------------ */

    				rules : {
    					name : {
    						required : true
    					},
    					param_key : {
    						required : true
    					},
    					sys_key : {
    						required : true
    					}
    				},

    				/* @validation error messages 
    				---------------------------------------------- */

    				messages : {
    					name : {
    						required : '请输入参数名称'
    					},
    					param_key : {
    						required : 'Enter last name'
    					},
    					sys_key : {
    						required : 'Enter email address'
    					}
    				},

    				/* @validation highlighting + error placement  
    				---------------------------------------------------- */

    				highlight : function(element, errorClass, validClass) {
    					//$(element).closest('.field').addClass(errorClass).removeClass(validClass);
    					$(element).closest('.field').addClass('has-error'); //bs自己的校验非法类
    				},
    				unhighlight : function(element, errorClass, validClass) {
    					//$(element).closest('.field').removeClass(errorClass).addClass(validClass);
    					$(element).closest('.field').removeClass('has-error'); //bs自己的校验非法类
    				},
    				errorPlacement : function(error, element) {
    					if (element.is(":radio") || element.is(":checkbox")) {
    						element.closest('.option-group').after(error);
    					} else {
    						//error.insertAfter(element.parent());
    						error.insertAfter(element);
    					}
    				} ,
    				submitHandler : function(form) {
    					alert(1);
    				} 

    			});
    			
    			$("#admin-form2").submit();
            }

		});
		/*]]>*/
	</script>

</body>

</html>
